<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>采灵侠 - 用电采集故障智能诊断平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        :root {
            --primary: #1a56db;
            --secondary: #0e9f6e;
            --danger: #e02424;
            --warning: #f59e0b;
            --info: #3f83f8;
            --dark: #1f2937;
            --light: #f9fafb;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        header {
            background: linear-gradient(135deg, var(--primary), #3f83f8);
            color: white;
            padding: 25px 30px;
            border-radius: 15px;
            margin-bottom: 25px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            display: flex;
            align-items: center;
        }
        
        .logo-icon {
            font-size: 2.8rem;
            margin-right: 15px;
            background: rgba(255, 255, 255, 0.2);
            padding: 15px;
            border-radius: 50%;
        }
        
        .logo-text h1 {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }
        
        .logo-text p {
            opacity: 0.9;
            font-size: 1rem;
        }
        
        .stats {
            display: flex;
            gap: 25px;
        }
        
        .stat-item {
            text-align: center;
            background: rgba(255, 255, 255, 0.2);
            padding: 12px 20px;
            border-radius: 10px;
            min-width: 120px;
        }
        
        .stat-value {
            font-size: 1.8rem;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .stat-label {
            font-size: 0.9rem;
            opacity: 0.9;
        }
        
        .dashboard {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
            margin-bottom: 25px;
        }
        
        .card {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s, box-shadow 0.3s;
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e5e7eb;
        }
        
        .card-title {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .card-title i {
            color: var(--primary);
        }
        
        .card-content {
            min-height: 200px;
        }
        
        .chart-container {
            width: 100%;
            height: 250px;
        }
        
        .status-list {
            list-style: none;
        }
        
        .status-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .status-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }
        
        .status-normal {
            background-color: var(--secondary);
        }
        
        .status-warning {
            background-color: var(--warning);
        }
        
        .status-danger {
            background-color: var(--danger);
        }
        
        .status-time {
            font-size: 0.85rem;
            color: #6b7280;
        }
        
        .process-flow {
            display: flex;
            justify-content: space-between;
            margin: 30px 0;
            position: relative;
        }
        
        .process-step {
            text-align: center;
            flex: 1;
            position: relative;
            z-index: 2;
        }
        
        .step-icon {
            width: 70px;
            height: 70px;
            background: var(--primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
            font-size: 1.8rem;
            box-shadow: 0 5px 15px rgba(26, 86, 219, 0.3);
        }
        
        .step-title {
            font-weight: 600;
            margin-bottom: 8px;
            font-size: 1.1rem;
        }
        
        .step-desc {
            font-size: 0.9rem;
            color: #666;
            line-height: 1.5;
            padding: 0 10px;
        }
        
        .process-flow:before {
            content: '';
            position: absolute;
            top: 35px;
            left: 10%;
            right: 10%;
            height: 3px;
            background: #ddd;
            z-index: 1;
        }
        
        .interactive-panel {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .panel-title {
            font-size: 1.4rem;
            margin-bottom: 20px;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .panel-title i {
            color: var(--primary);
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #374151;
        }
        
        select, button {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s;
        }
        
        select {
            background: white;
        }
        
        select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
        }
        
        button {
            background: var(--primary);
            color: white;
            border: none;
            cursor: pointer;
            font-weight: 600;
        }
        
        button:hover {
            background: #0e4da1;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(26, 86, 219, 0.3);
        }
        
        .result-box {
            margin-top: 25px;
            padding: 20px;
            background: #f8fafc;
            border-radius: 10px;
            border-left: 5px solid var(--primary);
            display: none;
        }
        
        .result-title {
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .notification-panel {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-top: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .notification-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 15px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .notification-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
        }
        
        .icon-email {
            background: var(--info);
        }
        
        .icon-sms {
            background: var(--secondary);
        }
        
        .icon-workorder {
            background: var(--warning);
        }
        
        .notification-content {
            flex: 1;
        }
        
        .notification-title {
            font-weight: 600;
            margin-bottom: 5px;
        }
        
        .notification-desc {
            font-size: 0.9rem;
            color: #666;
        }
        
        .notification-time {
            font-size: 0.8rem;
            color: #9ca3af;
        }
        
        footer {
            text-align: center;
            padding: 25px;
            margin-top: 30px;
            color: #6b7280;
            font-size: 0.9rem;
            border-top: 1px solid #e5e7eb;
        }
        
        @media (max-width: 768px) {
            .dashboard {
                grid-template-columns: 1fr;
            }
            
            header {
                flex-direction: column;
                text-align: center;
                gap: 20px;
            }
            
            .stats {
                width: 100%;
                justify-content: space-around;
            }
            
            .process-flow {
                flex-direction: column;
                gap: 30px;
            }
            
            .process-flow:before {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <div class="logo">
                <div class="logo-icon">
                    <i class="fas fa-bolt"></i>
                </div>
                <div class="logo-text">
                    <h1>用电采集故障智能诊断平台功能演示</h1>
                    <p>基于RPA+AI的故障诊断与闭环指挥系统</p>
                </div>
            </div>
            <div class="stats">
                <div class="stat-item">
                    <div class="stat-value">99.72%</div>
                    <div class="stat-label">采集成功率</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">18</div>
                    <div class="stat-label">今日故障数</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">15</div>
                    <div class="stat-label">已处理</div>
                </div>
            </div>
        </header>
        
        <div class="dashboard">
            <div class="card">
                <div class="card-header">
                    <div class="card-title"><i class="fas fa-chart-line"></i> 采集成功率趋势</div>
                </div>
                <div class="card-content">
                    <div id="successRateChart" class="chart-container"></div>
                </div>
            </div>
            
            <div class="card">
                <div class="card-header">
                    <div class="card-title"><i class="fas fa-chart-pie"></i> 故障类型分布</div>
                </div>
                <div class="card-content">
                    <div id="faultTypeChart" class="chart-container"></div>
                </div>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <div class="card-title"><i class="fas fa-tachometer-alt"></i> 系统运行状态</div>
            </div>
            <div class="card-content">
                <ul class="status-list">
                    <li class="status-item">
                        <div class="status-info">
                            <span class="status-indicator status-normal"></span>
                            RPA自动巡检服务
                        </div>
                        <div class="status-time">今日已执行2次巡检</div>
                    </li>
                    <li class="status-item">
                        <div class="status-info">
                            <span class="status-indicator status-normal"></span>
                            智能诊断引擎
                        </div>
                        <div class="status-time">运行正常</div>
                    </li>
                    <li class="status-item">
                        <div class="status-info">
                            <span class="status-indicator status-warning"></span>
                            通知服务
                        </div>
                        <div class="status-time">部分延迟</div>
                    </li>
                    <li class="status-item">
                        <div class="status-info">
                            <span class="status-indicator status-normal"></span>
                            数据可视化服务
                        </div>
                        <div class="status-time">运行正常</div>
                    </li>
                </ul>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <div class="card-title"><i class="fas fa-project-diagram"></i> 故障处理流程</div>
            </div>
            <div class="card-content">
                <div class="process-flow">
                    <div class="process-step">
                        <div class="step-icon">
                            <i class="fas fa-robot"></i>
                        </div>
                        <div class="step-title">自动巡检</div>
                        <div class="step-desc">RPA定时登录系统查询失败数据</div>
                    </div>
                    <div class="process-step">
                        <div class="step-icon">
                            <i class="fas fa-diagnoses"></i>
                        </div>
                        <div class="step-title">智能诊断</div>
                        <div class="step-desc">分析故障原因并自动分类</div>
                    </div>
                    <div class="process-step">
                        <div class="step-icon">
                            <i class="fas fa-bell"></i>
                        </div>
                        <div class="step-title">智能通知</div>
                        <div class="step-desc">分级发送告警信息</div>
                    </div>
                    <div class="process-step">
                        <div class="step-icon">
                            <i class="fas fa-tasks"></i>
                        </div>
                        <div class="step-title">工单处置</div>
                        <div class="step-desc">自动创建并跟踪处理工单</div>
                    </div>
                    <div class="process-step">
                        <div class="step-icon">
                            <i class="fas fa-chart-bar"></i>
                        </div>
                        <div class="step-title">数据分析</div>
                        <div class="step-desc">可视化展示与决策支持</div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="interactive-panel">
            <h2 class="panel-title"><i class="fas fa-search"></i> 故障诊断模拟</h2>
            <p>选择故障场景，体验系统自动诊断过程</p>
            
            <div class="form-group">
                <label for="faultScenario">选择故障场景</label>
                <select id="faultScenario">
                    <option value="">-- 请选择故障场景 --</option>
                    <option value="comm_failure">通信故障（集中器离线）</option>
                    <option value="meter_failure">设备故障（单表异常）</option>
                    <option value="archive_error">档案错误（户变关系不一致）</option>
                    <option value="power_outage">电源故障（线路停电）</option>
                </select>
            </div>
            
            <button id="diagnoseBtn"><i class="fas fa-play-circle"></i> 执行诊断</button>
            
            <div id="diagnosisResult" class="result-box">
                <div class="result-title"><i class="fas fa-clipboard-check"></i> 诊断结果</div>
                <p id="resultText"></p>
                <p id="suggestionText"></p>
            </div>
        </div>
        
        <div class="notification-panel">
            <h2 class="panel-title"><i class="fas fa-bell"></i> 智能通知记录</h2>
            
            <div class="notification-item">
                <div class="notification-icon icon-email">
                    <i class="fas fa-envelope"></i>
                </div>
                <div class="notification-content">
                    <div class="notification-title">内网邮件通知</div>
                    <div class="notification-desc">城镇供电所3个台区集中器离线，已通知该供电所</div>
                </div>
                <div class="notification-time">10:25</div>
            </div>
            
            <div class="notification-item">
                <div class="notification-icon icon-sms">
                    <i class="fas fa-sms"></i>
                </div>
                <div class="notification-content">
                    <div class="notification-title">短信提醒</div>
                    <div class="notification-desc">城镇供电所5块单相表采集失败，已发送至责任人王工</div>
                </div>
                <div class="notification-time">09:42</div>
            </div>
            
            <div class="notification-item">
                <div class="notification-icon icon-workorder">
                    <i class="fas fa-clipboard-list"></i>
                </div>
                <div class="notification-content">
                    <div class="notification-title">工单自动创建</div>
                    <div class="notification-desc">档案错误工单已创建，分配至营销业务班</div>
                </div>
                <div class="notification-time">08:15</div>
            </div>
        </div>
        
        <footer>
            <p>© 2025 县供电公司 - 青创赛项目用电信息采集智能诊断平台</p>
            <p>技术支持：信息通信班 | 数据更新时间：2023-11-15 14:30</p>
        </footer>
    </div>

    <script>
        // 初始化图表
        document.addEventListener('DOMContentLoaded', function() {
            // 采集成功率图表
            const successRateChart = echarts.init(document.getElementById('successRateChart'));
            const successRateOption = {
                tooltip: {
                    trigger: 'axis'
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    data: ['6:00', '8:00', '10:00', '12:00', '14:00', '16:00', '18:00'],
                    axisLine: {
                        lineStyle: {
                            color: '#9ca3af'
                        }
                    }
                },
                yAxis: {
                    type: 'value',
                    min: 98,
                    max: 100,
                    axisLabel: {
                        formatter: '{value}%'
                    },
                    splitLine: {
                        lineStyle: {
                            color: '#f3f4f6'
                        }
                    }
                },
                series: [{
                    data: [99.1, 99.3, 99.5, 99.4, 99.6, 99.7, 99.7],
                    type: 'line',
                    smooth: true,
                    lineStyle: {
                        width: 4,
                        color: '#1a56db'
                    },
                    areaStyle: {
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [{
                                offset: 0,
                                color: 'rgba(26, 86, 219, 0.3)'
                            }, {
                                offset: 1,
                                color: 'rgba(26, 86, 219, 0.05)'
                            }]
                        }
                    },
                    symbol: 'circle',
                    symbolSize: 8,
                    itemStyle: {
                        color: '#1a56db'
                    }
                }]
            };
            successRateChart.setOption(successRateOption);
            
            // 故障类型分布图表
            const faultTypeChart = echarts.init(document.getElementById('faultTypeChart'));
            const faultTypeOption = {
                tooltip: {
                    trigger: 'item',
                    formatter: '{a} <br/>{b}: {c} ({d}%)'
                },
                legend: {
                    orient: 'vertical',
                    right: 10,
                    top: 'center',
                    textStyle: {
                        color: '#6b7280'
                    }
                },
                series: [{
                    name: '故障类型',
                    type: 'pie',
                    radius: ['40%', '70%'],
                    avoidLabelOverlap: false,
                    itemStyle: {
                        borderRadius: 10,
                        borderColor: '#fff',
                        borderWidth: 2
                    },
                    label: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        label: {
                            show: true,
                            fontSize: '16',
                            fontWeight: 'bold'
                        }
                    },
                    labelLine: {
                        show: false
                    },
                    data: [
                        { value: 45, name: '通信故障' },
                        { value: 30, name: '设备故障' },
                        { value: 15, name: '档案错误' },
                        { value: 8, name: '电源故障' },
                        { value: 2, name: '其他' }
                    ],
                    color: ['#1a56db', '#0e9f6e', '#f59e0b', '#e02424', '#6b7280']
                }]
            };
            faultTypeChart.setOption(faultTypeOption);
            
            // 响应窗口大小变化
            window.addEventListener('resize', function() {
                successRateChart.resize();
                faultTypeChart.resize();
            });
            
            // 故障诊断模拟功能
            const diagnoseBtn = document.getElementById('diagnoseBtn');
            const faultScenario = document.getElementById('faultScenario');
            const diagnosisResult = document.getElementById('diagnosisResult');
            const resultText = document.getElementById('resultText');
            const suggestionText = document.getElementById('suggestionText');
            
            diagnoseBtn.addEventListener('click', function() {
                if (!faultScenario.value) {
                    alert('请先选择故障场景！');
                    return;
                }
                
                // 模拟诊断过程
                diagnoseBtn.disabled = true;
                diagnoseBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 诊断中...';
                
                setTimeout(function() {
                    let result = '';
                    let suggestion = '';
                    
                    switch(faultScenario.value) {
                        case 'comm_failure':
                            result = '诊断完成：通信类故障';
                            suggestion = '疑似集中器离线或通信模块故障。系统已自动创建工单并通知通信运维班组进行检查。';
                            break;
                        case 'meter_failure':
                            result = '诊断完成：设备类故障';
                            suggestion = '疑似单块电表故障或接线问题。系统已发送短信通知计量运维班组进行现场检查。';
                            break;
                        case 'archive_error':
                            result = '诊断完成：档案类故障';
                            suggestion = '疑似户变关系不一致，需核对档案。系统已通过内网邮件通知营销业务班组进行档案核对与修正。';
                            break;
                        case 'power_outage':
                            result = '诊断完成：电源类故障';
                            suggestion = '疑似线路停电，需与调度信息核对。系统已自动创建工单并升级通知配电运维班组确认停电情况。';
                            break;
                    }
                    
                    resultText.textContent = result;
                    suggestionText.textContent = suggestion;
                    diagnosisResult.style.display = 'block';
                    
                    diagnoseBtn.disabled = false;
                    diagnoseBtn.innerHTML = '<i class="fas fa-play-circle"></i> 执行诊断';
                }, 1500);
            });
        });
    </script>
</body>
</html>
